import { defineStore } from 'pinia'
import { ref } from 'vue'
import { TagType } from '@/types/types'

export const useTagStore = defineStore('tag', () => {
  const inComeTags = ref([
    '奖金',
    '收债',
    '利息收入',
    '薪资',
    '投资回收',
    '借入',
    '意外所得',
    '兼职',
    '其他'
  ])
  const outComeTags = ref([
    '美食',
    '打车',
    '零食',
    '电影',
    '购物',
    '服饰',
    '日用品',
    '娱乐',
    '水果',
    '医疗',
    '旅行',
    '社交',
    '其他'
  ])
  const selectTag = ref({
    income: inComeTags.value[0],
    outcome: outComeTags.value[0]
  })
  function setTag(type: TagType, tag: string) {
    selectTag.value[type] = tag
    console.log(selectTag.value)
  }
  return { inComeTags, outComeTags, selectTag, setTag }
})
